<template>
  <div class="app-container app-container-first-child-style">
    <div class="create-meeting-main">
      <!--  Flow One -->
      <template>
        <!--   创建会议 - 开始表格   -->
        <create-meeting-start
          ref="refCreateMeetingStart"
          :key="renderChildrenKeys.createMeetingStartKey"
          @children-component-request-update-render="childrenComponentRequestUpdateRender"
        />
        <!--    创建会议 - 上传项目   -->
        <create-meeting-project
          ref="refCreateMeetingProject"
          :key="renderChildrenKeys.createMeetingProjectKey"
          @children-component-request-update-render="childrenComponentRequestUpdateRender"
        />
      </template>
      <div class="create-meeting-submit-content">
        <el-button class="custom-submit-button" icon="el-icon-plus">创建项目</el-button>
      </div>
    </div>
  </div>
</template>

<script>
import CreateMeetingStart from './components/create-meeting-start'
import CreateMeetingProject from './components/create-meeting-project'

export default {
  name: 'CreateMeeting',
  components: {
    CreateMeetingStart,
    CreateMeetingProject
  },
  data() {
    return {
      meeting: {
        flow: 1
      },
      // 所有组件的 key 值
      renderChildrenKeys: {
        createMeetingStartKey: new Date().getTime() + 'createMeetingStartKey',
        createMeetingProjectKey: new Date().getTime() + 'createMeetingProjectKey'
      }
    }
  },
  methods: {
    // 接受子组件发送的重新渲染请求
    childrenComponentRequestUpdateRender(childrenNode) {
      this.renderChildrenKeys[childrenNode] = new Date().getTime() + childrenNode
    }
  }
}
</script>

<style lang="scss" scoped>
  .create-meeting-submit-content {
    text-align: center;
  }
</style>
